import request from '@/utils/request'

export function getAllJob(deptId) {
  const params = {
    deptId,
    page: 1,
    size: 9999
  }
  return request({
    url: 'api/sysPost',
    method: 'get',
    params
  })
}
export function sysPostList(deptId) {
  const params = {
    deptId,
    page: 1,
    size: 9999
  }
  return request({
    url: 'api/dropDown/sysPostList',
    method: 'get',
    params
  })
}
export function add(data) {
  return request({
    url: 'api/sysPost/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/sysPost',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/sysPost/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/sysPost/copy',
    method: 'post',
    data
  })
}

export function enableOrDisable(data) {
  return request({
    url: 'api/sysPost/enableOrDisable',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/sysPost/export',
    method: 'get',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/sysPost/import',
    method: 'get',
    data
  })
}

export default { add, edit, del, enableOrDisable, copy, exportDe, importDe, getAllJob }
